<?php 
$categories = Category::order_by('updated_at', 'desc')->get();
$categories = isset($categories) ? $categories:array();
?>
<div class='container-fluid'>
<?php echo View::make('share.backend_nav')->with('nav', Config::get('app.nav.product.sub'));?>
<div class='board'>


<span class='label label-info pull-left'>商品类型列表</span>
<a href='javascript:void(0)' class='label label-success pull-right' id='add-category'>新增</a>
<table class='table table-bordered'>
  <thead>
    <tr>
      <th class='id'>#ID</th>
      <th class='cname'>#类型名称</th>
      <th class='tag'>#Tag</th>
      <th class='op'>#OP</th>
      <th class='op'>#OP</th>
    </tr>
  </thead>
  <tbody>
  <?php foreach ($categories as $m):?>
    <tr>
      <td><?php echo $m->id;?></td>
      <td><?php echo $m->cname;?></td>
      <td><?php echo $m->tag;?></td>
      <td><a href='javascript:void(0)' class='btn btn-mini btn-primary edit'  data-id='<?php echo $m->id;?>' data-cname='<?php echo $m->cname;?>' data-ename='<?php echo $m->ename;?>' data-tag='<?php echo $m->tag;?>'>修改</a></td>
      <td><a href='javascript:void(0)' class='btn btn-mini btn-danger delete' data-id='<?php echo $m->id;?>'>删除</a></td>
    </tr>
  <?php endforeach;?>
  </tbody>
</table>
</div>
</div>
<?php echo View::make('product.category.add_modal');?>
<?php echo View::make('product.category.edit_modal');?>
